//-------------------------------------  PHONG ---------------------
//        var PATH_GIAITRI = "http://entertainment.timnhanhdev.com/";

        var split_1        = '|'; //-- Ngăn cách giữa các cặp giá trị tạo nên một bài hát
        var split_2        = '~'; //-- Ngăn cách giữa tên bài hát và ID bài hát
        var playlistWindow = null;

        /*------------------------------------------------------\
        |        Add song to playlist                                                                |
        |        Code by mrdotcom@gmail.com                                                        |
        \------------------------------------------------------*/
        var playlistRowHeight = 20;
        function add2playlist(song_id, song_name)
        {
                //-- Srote via cookie
                //
                c = __cookie.getSubValue(c_name);
                if(!c)
                {
                        c = "";
                }
                else
                {
                        //-- Kiem tra xem bai hat nay da co trong playlist chua
                        //
                        cc = c.split(split_1);

                        for(i = 0; i < cc.length; i++)
                        {
                                if(cc[i])
                                {
                                        s = cc[i].split(split_2);
                                        if( s[0] == song_id )
                                        {
                                                alert('Bài này đã có trong playlist rồi');
                                                return;
                                        }
                                }
                        }
                }
                c = c + split_1 + song_id + split_2 + song_name;
                __cookie.setSubValue(c_name, c);
                var pl = findObj('playlist');

                alert('Bài hát "'+song_name+'" đã được thêm vào playlist của bạn');
        }

        function playlistRemove(song_id)
        {
                c = __cookie.getSubValue(c_name); var nc = '';

                if(!c) return false;
                else
                {
                        //-- Kiem tra xem bai hat nay da co trong playlist chua
                        //
                        cc = c.split(split_1);

                        for(i = 0; i < cc.length; i++)
                        {
                                if(cc[i])
                                {
                                        s = cc[i].split(split_2);
                                        if( s[0] != song_id )
                                        {
                                                nc = nc + split_1 + s[0] + split_2 + s[1];
                                        }
                                }
                        }

                        __cookie.setSubValue(c_name, nc);

                        showPlaylist();
                }

                return ;
        }

        function listenMusic(id)
        {
                //location.href = PATH_GIAITRI+"music/playlist/"+id+"/";


                 //  location.href = "playlist.php?songId="+id;
                 window.location ='playlist.php?song=' + id ;
        }

        function showPlaylist()
        {
                var c = ""; var up = ""; var s = "";
                c = __cookie.getSubValue(c_name);

                if(c)
                {
                        c = c.split(split_1);
                        song = new Array();
                        count = 0;
                        for(i = c.length- 1; i>=0; i--)
                        {
                                if(c[i])
                                {
                                        s = c[i].split(split_2);
                                        song[count] = new Array();
                                        song[count]['id'] = s[0];
                                        song[count]['name'] = s[1];
                                        count++;
                                }
                        }
                        //Sort songs
                        if (song.length>1)
                        {
                                for(i = 1; i<song.length; i++)
                                {
                                        if (parseInt(song[i]['id'])<parseInt(song[i-1]['id']))
                                        {
                                                tmp = song[i];
                                                song[i] = song[i-1];
                                                song[i-1] = tmp;
                                        }
                                }
                        }
                        var html = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" class="pad_top_10"><div align="center" class="pad_leftright_05"><a href="playlist.php">NGHE TOÀN BỘ PLAYLIST</a></div></td></tr><tr><td height="5"></td></tr><tr><td height="1" class="bg_red_1"></td></tr></table>';
                        for(i = 0; i<song.length; i++)
                        {
                                song_name = '<table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr><td class="pad_top_10"><div id="'+song[i]['id']+'" class="pad_leftright_05"><a href="javascript:playlistRemove(\''+song[i]['id']+'\');"><img src="images/icon_del.gif" border="0" align="absmiddle"></a>&nbsp;&nbsp;<span class="text_white_11_3"><a href="javascript:listenMusic(\''+song[i]['id']+'\');">' + song[i]['name'] + '</a>&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;<span id="song_'+song[i]['id']+'"></span></span></div></td></tr><tr><td height="5"></td></tr><tr><td height="1" class="bg_red_1"></td></tr></table>';
                                html += (song_name);
                        }
                        document.getElementById('playlist').innerHTML = html;
                        for(i = 0; i<song.length; i++)
                        {

                                showSingersOfSong(song[i]['id']);
                        }
                }
                else
                {
                        alert('Danh sách nhạc của bạn hiện đang rỗng');
                        window.close();
                }
        }
        function showPLayer(link, movie)
        {

                var height = 45;
                if (movie)
                        height = 200;
                var WMP7;
                if (navigator.userAgent.indexOf("MSIE")>=0)
                {
                        //IE
                        if (location.href.indexOf("playlist")>=0)
                                width = 310;
                        else
                                width = 385;
                }
                else
                {
                        //Other
                        width = 385;
                }
                try
                {
                        if ( navigator.appName != "Netscape" )
                        {
                                WMP7 = new ActiveXObject('WMPlayer.OCX');
                        }
                }
                catch (error)
                {
                        ;
                }
               var HTML = '';





                // Windows Media Player 7 Code
                if ( WMP7 )
                {

                HTML +=  ('<OBJECT id=PlayerS height="'+height+'" width="100%" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" VIEWASTEXT>');
                //HTML +=  ('<PARAM NAME="URL" VALUE="'+link+'">');
                HTML +=  ('<PARAM NAME="URL" VALUE="'+link+'">');
                HTML +=  ('<PARAM NAME="rate" VALUE="1">');
                HTML +=  ('<PARAM NAME="balance" VALUE="0">');
                HTML +=  ('<PARAM NAME="currentPosition" VALUE="0">');
                HTML +=  ('<PARAM NAME="defaultFrame" VALUE="">');
                HTML +=  ('<PARAM NAME="playCount" VALUE="999">');
                HTML +=  ('<PARAM NAME="autoStart" VALUE="1">');
                HTML +=  ('<PARAM NAME="currentMarker" VALUE="0">');
                HTML +=  ('<PARAM NAME="invokeURLs" VALUE="-1">');
                HTML +=  ('<PARAM NAME="baseURL" VALUE="">');
                HTML +=  ('<PARAM NAME="mute" VALUE="0">');
                HTML +=  ('<PARAM NAME="uiMode" VALUE="full">');
                HTML +=  ('<PARAM NAME="stretchToFit" VALUE="0">');
                HTML +=  ('<PARAM NAME="windowlessVideo" VALUE="1">');
                HTML +=  ('<PARAM NAME="enabled" VALUE="-1">');
                HTML +=  ('<PARAM NAME="enableContextMenu" VALUE="0">');
                HTML +=  ('<PARAM NAME="fullScreen" VALUE="0">');
                HTML +=  ('<PARAM NAME="SAMIStyle" VALUE="">');
                HTML +=  ('<PARAM NAME="SAMILang" VALUE="">');
                HTML +=  ('<PARAM NAME="SAMIFilename" VALUE="">');
                HTML +=  ('<PARAM NAME="captioningID" VALUE="">');
                HTML +=  ('<PARAM NAME="Volume" VALUE="100">');
                HTML +=  ('</OBJECT>');

                }

                // Windows Media Player 6.4 Code
                else
                {
                //alert(link);

                /*
                HTML +=  ('<OBJECT id="WMPlayer" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
                HTML +=  ('codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" ');
                HTML +=  ('width="'+width+'" height="'+height+'"');
                HTML +=  ('standby="Loading Microsoft Windows Media Player components..." ');
                HTML +=  ('type="application/x-oleobject" VIEWASTEXT> ');
                HTML +=  ('<PARAM NAME="FileName"           VALUE="'+link+'">');
                HTML +=  ('<PARAM NAME="TransparentAtStart" Value="false">');
                HTML +=  ('<PARAM NAME="AutoStart"          Value="true">');
                HTML +=  ('<PARAM NAME="AnimationatStart"   Value="false">');
                HTML +=  ('<PARAM NAME="ShowControls"       Value="false">');
                HTML +=  ('<PARAM NAME="ShowDisplay"         value ="false">');
                HTML +=  ('<PARAM NAME="playCount" VALUE="999">');
                HTML +=  ('<PARAM NAME="displaySize"          Value="0">');
                HTML +=  ('<PARAM NAME="Volume" VALUE="100">');
                HTML +=  ('<param name="enableContextMenu" value="0">');

                HTML +=  ('<Embed type="application/x-mplayer2" ');
                HTML +=  ('pluginspage= ');
                HTML +=  ('"http://www.microsoft.com/Windows/MediaPlayer/" ');
                HTML +=  ('src="playnotie.php?url=' + link + '"');
                HTML +=  ('Name=MediaPlayer ');
                HTML +=  ('transparentAtStart=0 ');
                HTML +=  ('autostart=1 ');
                HTML +=  ('playcount=999 ');
                HTML +=  ('volume=100');
                HTML +=  ('animationAtStart=0 ');
                HTML +=  ('width="100%" height="'+height+'"');
                HTML +=  ('displaySize=0></embed> ');
                HTML +=  ('</OBJECT> ');

                */


              // Windows Media 10



               HTML +=  ('<OBJECT   ID="PlayerS" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" WIDTH=370 HEIGHT=45>');
               HTML +=  ('<PARAM NAME="AutoStart" VALUE="True" >');
               HTML +=  ('<PARAM NAME="URL" VALUE="'+ link +'">');
               HTML +=  ('<!-- Turn off the controls -->');
               HTML +=  ('<PARAM NAME="uiMode" VALUE="full">');
               HTML +=  ('<PARAM NAME="wmode" VALUE="transparent">')
               HTML +=  ('<EMBED TYPE="application/x-mplayer2"');
               HTML +=  ('SRC="'+ link +'"');
               HTML +=  ('transparent=0');
               HTML +=  ('NAME="Player"');
               HTML +=  ('VOLUME="100"');
               HTML +=  ('WIDTH="370"');
               HTML +=  ('HEIGHT="45"');
               HTML +=  ('AUTOSTART="1"');
               HTML +=  ('SHOWCONTROLS="false">');
               HTML +=  ('</EMBED>');
               HTML +=  ('</OBJECT>');


                }
                return HTML;
        }
        //Lay danh sach cac ca si the hien ca khuc


        function showSingersOfSong(songId)
        {
                var url="getinfor.php?view=song&a=singers_infor&songid="+songId;
                var objXmlHttp=null
                if (navigator.userAgent.indexOf("Opera")>=0)
                {
                        alert("This example doesn't work in Opera")
                        return
                }
                if (navigator.userAgent.indexOf("MSIE")>=0)
                {
                        var strName="Msxml2.XMLHTTP"
                        if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
                        {
                                strName="Microsoft.XMLHTTP"
                        }
                        try
                        {
                                objXmlHttp=new ActiveXObject(strName)
                                objXmlHttp.open("GET", url , true)
                                objXmlHttp.send(null)
                                objXmlHttp.onreadystatechange=function(){
                                        if (objXmlHttp.readyState==4)
                                        {

                                                findObj("song_"+songId).innerHTML = objXmlHttp.responseText
                                        }
                                }
                        }
                        catch(e)
                        {
                               // alert("Error. Scripting for ActiveX might be disabled")
                                return
                        }
                }else
                if (navigator.userAgent.indexOf("Firefox")>=0)

                {






                  var request  = new XMLHttpRequest();
                     request.open('get', 'getinfor.php?view=song&a=singers_infor&songid='+songId);
                     request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                     request.onreadystatechange = function(){

                     if (request.readyState ==4)
                     {

                      findObj("song_"+songId).innerHTML = request.responseText;
                     }
                    }

                     request.send('');

                    /*
                        objXmlHttp=new XMLHttpRequest()
                        objXmlHttp.open("GET", url , true)
                        objXmlHttp.send(null)
                        objXmlHttp.onload=function()
                        {

                                if (objXmlHttp.readyState==4 || objXmlHttp.readyState=="complete")
                                {
                                        findObj("song_"+songId).innerHTML = 'ssssss';
                                }
                        }
                        objXmlHttp.onerror=function(){

                        alert('FF');
                                return ;
                        }
                    */
                   // get_method(songId);


                    //findObj("song_"+songId).innerHTML = request.responseText;
                }
        }

        function loadPlayer()
        {
                var l = self.location + '';
                if(l.indexOf('?') == -1)
                {
                        obj = findObj("player");
                        document.write(showPLayer(PATH_GIAITRI+'playlist/list/'));
                }
        }
        function showAlbumRate()
        {
                if (req.readyState==4 || req.readyState=="complete")
                {
                        point = parseFloat(req.responseText);
                        showPoint('album_rate_result', point);
                }
        }

        function showPoint(sName, point)
        {
                var obj = document.getElementById(sName);
                var e = "g";
                if (sName=="film_result")
                        e = "w";
                if (obj)
                {
                        obj.innerHTML = '';
                        for (i=1; i<=Math.floor(point); i++)
                        {
                                obj.innerHTML += '<img src="images/icon_star_full_'+e+'.gif" width="21" height="20">';
                        }
                        for (i=Math.floor(point);i<Math.ceil(point); i++)
                        {
                                if ((point+0.5)>Math.ceil(point))
                                        obj.innerHTML += '<img src="images/icon_star_full_'+e+'.gif" width="21" height="20">';
                                else
                                        obj.innerHTML += '<img src="images/icon_star_half_'+e+'.gif" width="21" height="20">';
                        }
                        for (i=Math.ceil(point)+1;i<=5; i++)
                        {
                                obj.innerHTML += '<img src="images/icon_star_empty_'+e+'.gif" width="21" height="20">';
                        }
                }
        }
                /*
        function updateAlbumRate(albumId)
        {
                loadXMLDoc(PATH_GIAITRI+"music/album/rate/result-"+albumId+"/", "showAlbumRate()");
        }
                */


function urlDecode(str){
    str=str.replace(new RegExp('\\+','g'),' ');
    return unescape(str);
}
function urlEncode(str){
    str=escape(str);
    str=str.replace(new RegExp('\\+','g'),'%2B');
    return str.replace(new RegExp('%20','g'),'+');
}

var END_OF_INPUT = -1;

var base64Chars = new Array(
    'A','B','C','D','E','F','G','H',
    'I','J','K','L','M','N','O','P',
    'Q','R','S','T','U','V','W','X',
    'Y','Z','a','b','c','d','e','f',
    'g','h','i','j','k','l','m','n',
    'o','p','q','r','s','t','u','v',
    'w','x','y','z','0','1','2','3',
    '4','5','6','7','8','9','+','/'
);

var reverseBase64Chars = new Array();
for (var i=0; i < base64Chars.length; i++){
    reverseBase64Chars[base64Chars[i]] = i;
}

var base64Str;
var base64Count;
function setBase64Str(str){
    base64Str = str;
    base64Count = 0;
}
function readBase64(){
    if (!base64Str) return END_OF_INPUT;
    if (base64Count >= base64Str.length) return END_OF_INPUT;
    var c = base64Str.charCodeAt(base64Count) & 0xff;
    base64Count++;
    return c;
}
function encodeBase64(str){
    setBase64Str(str);
    var result = '';
    var inBuffer = new Array(3);
    var lineCount = 0;
    var done = false;
    while (!done && (inBuffer[0] = readBase64()) != END_OF_INPUT){
        inBuffer[1] = readBase64();
        inBuffer[2] = readBase64();
        result += (base64Chars[ inBuffer[0] >> 2 ]);
        if (inBuffer[1] != END_OF_INPUT){
            result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30) | (inBuffer[1] >> 4) ]);
            if (inBuffer[2] != END_OF_INPUT){
                result += (base64Chars [((inBuffer[1] << 2) & 0x3c) | (inBuffer[2] >> 6) ]);
                result += (base64Chars [inBuffer[2] & 0x3F]);
            } else {
                result += (base64Chars [((inBuffer[1] << 2) & 0x3c)]);
                result += ('=');
                done = true;
            }
        } else {
            result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30)]);
            result += ('=');
            result += ('=');
            done = true;
        }
        lineCount += 4;
        if (lineCount >= 76){
            result += ('\n');
            lineCount = 0;
        }
    }
    return result;
}
function readReverseBase64(){
    if (!base64Str) return END_OF_INPUT;
    while (true){
        if (base64Count >= base64Str.length) return END_OF_INPUT;
        var nextCharacter = base64Str.charAt(base64Count);
        base64Count++;
        if (reverseBase64Chars[nextCharacter]){
            return reverseBase64Chars[nextCharacter];
        }
        if (nextCharacter == 'A') return 0;
    }
    return END_OF_INPUT;
}

function ntos(n){
    n=n.toString(16);
    if (n.length == 1) n="0"+n;
    n="%"+n;
    return unescape(n);
}

function decodeBase64(str){
    setBase64Str(str);
    var result = "";
    var inBuffer = new Array(4);
    var done = false;
    while (!done && (inBuffer[0] = readReverseBase64()) != END_OF_INPUT
        && (inBuffer[1] = readReverseBase64()) != END_OF_INPUT){
        inBuffer[2] = readReverseBase64();
        inBuffer[3] = readReverseBase64();
        result += ntos((((inBuffer[0] << 2) & 0xff)| inBuffer[1] >> 4));
        if (inBuffer[2] != END_OF_INPUT){
            result +=  ntos((((inBuffer[1] << 4) & 0xff)| inBuffer[2] >> 2));
            if (inBuffer[3] != END_OF_INPUT){
                result +=  ntos((((inBuffer[2] << 6)  & 0xff) | inBuffer[3]));
            } else {
                done = true;
            }
        } else {
            done = true;
        }
    }
    return result;
}

var digitArray = new Array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
function toHex(n){
    var result = ''
    var start = true;
    for (var i=32; i>0;){
        i-=4;
        var digit = (n>>i) & 0xf;
        if (!start || digit != 0){
            start = false;
            result += digitArray[digit];
        }
    }
    return (result==''?'0':result);
}

function pad(str, len, pad){
    var result = str;
    for (var i=str.length; i<len; i++){
        result = pad + result;
    }
    return result;
}

function encodeHex(str){
    var result = "";
    for (var i=0; i<str.length; i++){
        result += pad(toHex(str.charCodeAt(i)&0xff),2,'0');
    }
    return result;
}

function decodeHex(str){
    str = str.replace(new RegExp("s/[^0-9a-zA-Z]//g"));
    var result = "";
    var nextchar = "";
    for (var i=0; i<str.length; i++){
        nextchar += str.charAt(i);
        if (nextchar.length == 2){
            result += ntos(eval('0x'+nextchar));
            nextchar = "";
        }
    }
    return result;

}

 function showPLayerlm(link,movie)
        {



                var linkno =  link;

                var link = link;

                link = decodeHex(decodeBase64(link));

                //alert(link);

                var height = 64;
                var heightA = 45;
                if (movie)
                {
                        height = 200;
                        heightA = 200;
                }
                var WMP7;
                if (navigator.userAgent.indexOf("MSIE")>=0)
                {
                        //IE
                        if (location.href.indexOf("playlist")>=0)
                                width = 310;
                        else
                                width = 385;
                }
                else
                {
                        //Other
                        width = 385;
                }
                try
                {
                        if ( navigator.appName != "Netscape" )
                        {
                                WMP7 = new ActiveXObject('WMPlayer.OCX');
                        }
                }
                catch (error)
                {
                        ;
                }
               var HTML = '';





                // Windows Media Player 7 Code
                if ( WMP7 )
                {

                HTML +=  ('<OBJECT height="'+ height +'" width="100%" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" VIEWASTEXT>');
                //HTML +=  ('<PARAM NAME="URL" VALUE="'+link+'">');
                HTML +=  ('<PARAM NAME="URL" VALUE="'+link+'">');
                HTML +=  ('<PARAM NAME="rate" VALUE="1">');
                HTML +=  ('<PARAM NAME="balance" VALUE="0">');
                HTML +=  ('<PARAM NAME="currentPosition" VALUE="0">');
                HTML +=  ('<PARAM NAME="defaultFrame" VALUE="">');
                HTML +=  ('<PARAM NAME="playCount" VALUE="999">');
                HTML +=  ('<PARAM NAME="autoStart" VALUE="1">');
                HTML +=  ('<PARAM NAME="currentMarker" VALUE="0">');
                HTML +=  ('<PARAM NAME="invokeURLs" VALUE="-1">');
                 HTML +=  ('<PARAM NAME="mute" VALUE="0">');
                HTML +=  ('<PARAM NAME="uiMode" VALUE="full">');
                HTML +=  ('<PARAM NAME="stretchToFit" VALUE="0">');
                HTML +=  ('<PARAM NAME="windowlessVideo" VALUE="1">');
                HTML +=  ('<PARAM NAME="enabled" VALUE="-1">');
                HTML +=  ('<PARAM NAME="enableContextMenu" VALUE="0">');
                HTML +=  ('<PARAM NAME="fullScreen" VALUE="0">');
                HTML +=  ('<PARAM NAME="SAMIStyle" VALUE="">');
                HTML +=  ('<PARAM NAME="SAMILang" VALUE="">');
                HTML +=  ('<PARAM NAME="SAMIFilename" VALUE="">');
                HTML +=  ('<PARAM NAME="captioningID" VALUE="">');
                HTML +=  ('<PARAM NAME="Volume" VALUE="100">');
                HTML +=  ('</OBJECT>');

                }

                // Windows Media Player 6.4 Code
                else
                {
                //alert(link);

                /*

                HTML +=  ('<OBJECT id="WMPlayer" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
                HTML +=  ('codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" ');
                HTML +=  ('width="'+width+'" height="'+height+'"');
                HTML +=  ('standby="Loading Microsoft Windows Media Player components..." ');
                HTML +=  ('type="application/x-oleobject" VIEWASTEXT> ');
                HTML +=  ('<PARAM NAME="FileName"           VALUE="'+link+'">');
                HTML +=  ('<PARAM NAME="TransparentAtStart" Value="false">');
                HTML +=  ('<PARAM NAME="AutoStart"          Value="true">');
                HTML +=  ('<PARAM NAME="AnimationatStart"   Value="false">');
                HTML +=  ('<PARAM NAME="ShowControls"       Value="false">');
                HTML +=  ('<PARAM NAME="ShowDisplay"         value ="false">');
                HTML +=  ('<PARAM NAME="playCount" VALUE="999">');
                HTML +=  ('<PARAM NAME="displaySize"          Value="0">');
                HTML +=  ('<PARAM NAME="Volume" VALUE="100">');
                HTML +=  ('<param name="enableContextMenu" value="0">');

                HTML +=  ('<Embed type="application/x-mplayer2" ');
                HTML +=  ('pluginspage= ');
                HTML +=  ('"http://www.microsoft.com/Windows/MediaPlayer/" ');
                HTML +=  ('src="' + link+ '"');
                HTML +=  ('Name=MediaPlayer ');
                HTML +=  ('transparentAtStart=0 ');
                HTML +=  ('autostart=1 ');
                HTML +=  ('playcount=999 ');
                HTML +=  ('volume=100');
                HTML +=  ('animationAtStart=0 ');
                HTML +=  ('width="100%" height="'+height+'"');
                HTML +=  ('displaySize=0></embed> ');
                HTML +=  ('</OBJECT> ');


              */

              // Windows Media 10



               HTML += ('<OBJECT ID="Player" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" WIDTH=385 HEIGHT='+heightA+'>');
               HTML += ('<PARAM NAME="AutoStart" VALUE="True" >');
               HTML +=  ('<PARAM NAME="URL" VALUE="playnotie.php?url='+ linkno+'">');
               HTML +=  ('<!-- Turn off the controls -->');
               HTML +=  ('<PARAM NAME="uiMode" VALUE="full">');
               HTML +=  ('<EMBED TYPE="application/x-mplayer2"');
               HTML +=  ('SRC="playnotie.php?url='+ linkno +'"');
               HTML +=  ('NAME="Player"');
               HTML +=  ('VOLUME="100"');
               HTML +=  ('WIDTH="385"');
               HTML +=  ('HEIGHT="'+heightA+'"');
               HTML +=  ('AUTOSTART="1"');
               HTML +=  ('SHOWCONTROLS="false">');
               HTML +=  ('</EMBED>');
               HTML +=  ('</OBJECT>');
               /*
               HTML += ('<OBJECT ID="Player" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" WIDTH=380 HEIGHT=45>');
               HTML += ('<PARAM NAME="AutoStart" VALUE="True" >');
               HTML +=  ('<PARAM NAME="URL" VALUE="do/'+ linkno+'">');
               HTML +=  ('<!-- Turn off the controls -->');
               HTML +=  ('<PARAM NAME="uiMode" VALUE="full">');
               HTML +=  ('<EMBED TYPE="application/x-mplayer2"');
               HTML +=  ('SRC="do/'+ linkno +'"');
               HTML +=  ('NAME="Player"');
               HTML +=  ('VOLUME="100"');
               HTML +=  ('WIDTH="380"');
               HTML +=  ('HEIGHT="45"');
               HTML +=  ('AUTOSTART="1"');
               HTML +=  ('SHOWCONTROLS="false">');
               HTML +=  ('</EMBED>');
               HTML +=  ('</OBJECT>');
               */
                }
                return HTML;
        }

function showPLayerlmlist(link,movie)
        {



                var linkno =  link;

                var link = link;

                link = decodeHex(decodeBase64(link));

                //alert(link);

                var height = 64;
                var heightA = 45;
                if (movie)
                {
                        height = 200;
                        heightA = 200;
                }
                var WMP7;
                if (navigator.userAgent.indexOf("MSIE")>=0)
                {
                        //IE
                        if (location.href.indexOf("playlist")>=0)
                                width = 310;
                        else
                                width = 385;
                }
                else
                {
                        //Other
                        width = 385;
                }
                try
                {
                        if ( navigator.appName != "Netscape" )
                        {
                                WMP7 = new ActiveXObject('WMPlayer.OCX');
                        }
                }
                catch (error)
                {
                        ;
                }
               var HTML = '';





                // Windows Media Player 7 Code
                if ( WMP7 )
                {

                HTML +=  ('<OBJECT height="'+ height +'" width="100%" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" VIEWASTEXT>');
                //HTML +=  ('<PARAM NAME="URL" VALUE="'+link+'">');
                HTML +=  ('<PARAM NAME="URL" VALUE="'+link+'">');
                HTML +=  ('<PARAM NAME="rate" VALUE="1">');
                HTML +=  ('<PARAM NAME="balance" VALUE="0">');
                HTML +=  ('<PARAM NAME="currentPosition" VALUE="0">');
                HTML +=  ('<PARAM NAME="defaultFrame" VALUE="">');
                HTML +=  ('<PARAM NAME="playCount" VALUE="999">');
                HTML +=  ('<PARAM NAME="autoStart" VALUE="1">');
                HTML +=  ('<PARAM NAME="currentMarker" VALUE="0">');
                HTML +=  ('<PARAM NAME="invokeURLs" VALUE="-1">');
                 HTML +=  ('<PARAM NAME="mute" VALUE="0">');
                HTML +=  ('<PARAM NAME="uiMode" VALUE="full">');
                HTML +=  ('<PARAM NAME="stretchToFit" VALUE="0">');
                HTML +=  ('<PARAM NAME="windowlessVideo" VALUE="1">');
                HTML +=  ('<PARAM NAME="enabled" VALUE="-1">');
                HTML +=  ('<PARAM NAME="enableContextMenu" VALUE="0">');
                HTML +=  ('<PARAM NAME="fullScreen" VALUE="0">');
                HTML +=  ('<PARAM NAME="SAMIStyle" VALUE="">');
                HTML +=  ('<PARAM NAME="SAMILang" VALUE="">');
                HTML +=  ('<PARAM NAME="SAMIFilename" VALUE="">');
                HTML +=  ('<PARAM NAME="captioningID" VALUE="">');
                HTML +=  ('<PARAM NAME="Volume" VALUE="100">');
                HTML +=  ('</OBJECT>');

                }

                // Windows Media Player 6.4 Code
                else
                {
                //alert(link);

                /*

                HTML +=  ('<OBJECT id="WMPlayer" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
                HTML +=  ('codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" ');
                HTML +=  ('width="'+width+'" height="'+height+'"');
                HTML +=  ('standby="Loading Microsoft Windows Media Player components..." ');
                HTML +=  ('type="application/x-oleobject" VIEWASTEXT> ');
                HTML +=  ('<PARAM NAME="FileName"           VALUE="'+link+'">');
                HTML +=  ('<PARAM NAME="TransparentAtStart" Value="false">');
                HTML +=  ('<PARAM NAME="AutoStart"          Value="true">');
                HTML +=  ('<PARAM NAME="AnimationatStart"   Value="false">');
                HTML +=  ('<PARAM NAME="ShowControls"       Value="false">');
                HTML +=  ('<PARAM NAME="ShowDisplay"         value ="false">');
                HTML +=  ('<PARAM NAME="playCount" VALUE="999">');
                HTML +=  ('<PARAM NAME="displaySize"          Value="0">');
                HTML +=  ('<PARAM NAME="Volume" VALUE="100">');
                HTML +=  ('<param name="enableContextMenu" value="0">');

                HTML +=  ('<Embed type="application/x-mplayer2" ');
                HTML +=  ('pluginspage= ');
                HTML +=  ('"http://www.microsoft.com/Windows/MediaPlayer/" ');
                HTML +=  ('src="' + link+ '"');
                HTML +=  ('Name=MediaPlayer ');
                HTML +=  ('transparentAtStart=0 ');
                HTML +=  ('autostart=1 ');
                HTML +=  ('playcount=999 ');
                HTML +=  ('volume=100');
                HTML +=  ('animationAtStart=0 ');
                HTML +=  ('width="100%" height="'+height+'"');
                HTML +=  ('displaySize=0></embed> ');
                HTML +=  ('</OBJECT> ');


              */

              // Windows Media 10



               HTML += ('<OBJECT ID="Player" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" WIDTH=310 HEIGHT='+heightA+'>');
               HTML += ('<PARAM NAME="AutoStart" VALUE="True" >');
               HTML +=  ('<PARAM NAME="URL" VALUE="playnotie.php?url='+ linkno+'">');
               HTML +=  ('<!-- Turn off the controls -->');
               HTML +=  ('<PARAM NAME="uiMode" VALUE="full">');
               HTML +=  ('<EMBED TYPE="application/x-mplayer2"');
               HTML +=  ('SRC="playnotie.php?url='+ linkno +'"');
               HTML +=  ('NAME="Player"');
               HTML +=  ('VOLUME="100"');
               HTML +=  ('WIDTH="310"');
               HTML +=  ('HEIGHT="'+heightA+'"');
               HTML +=  ('AUTOSTART="1"');
               HTML +=  ('SHOWCONTROLS="false">');
               HTML +=  ('</EMBED>');
               HTML +=  ('</OBJECT>');
               /*
               HTML += ('<OBJECT ID="Player" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" WIDTH=380 HEIGHT=45>');
               HTML += ('<PARAM NAME="AutoStart" VALUE="True" >');
               HTML +=  ('<PARAM NAME="URL" VALUE="do/'+ linkno+'">');
               HTML +=  ('<!-- Turn off the controls -->');
               HTML +=  ('<PARAM NAME="uiMode" VALUE="full">');
               HTML +=  ('<EMBED TYPE="application/x-mplayer2"');
               HTML +=  ('SRC="do/'+ linkno +'"');
               HTML +=  ('NAME="Player"');
               HTML +=  ('VOLUME="100"');
               HTML +=  ('WIDTH="380"');
               HTML +=  ('HEIGHT="45"');
               HTML +=  ('AUTOSTART="1"');
               HTML +=  ('SHOWCONTROLS="false">');
               HTML +=  ('</EMBED>');
               HTML +=  ('</OBJECT>');
               */
                }
                return HTML;
        }